<template>
  <div style="margin: 100px auto; width: 90%;">
    <h1 class="tc">{{ status?.name || '未获取' }}</h1>
    <el-descriptions title="" direction="vertical" :column="1" border>
      <el-descriptions-item label="证件号码">{{ status?.codeNumber || '未获取' }}</el-descriptions-item>
      <el-descriptions-item label="下一次随访时间">{{ status?.nextFollowTime || '未获取' }}</el-descriptions-item>
      <el-descriptions-item label="随访状态">{{ status?.followStatus || '未获取' }}</el-descriptions-item>
      <el-descriptions-item label="随访超时">
        <el-tag :type="status?.followTimeOut === '已超时' ? 'danger' : ''">{{ status?.followTimeOut || '未获取' }}</el-tag>
      </el-descriptions-item>
    </el-descriptions>
    <div class="dialog-footer">
      <el-button type="primary" @click="loadStatus()">获取随访状态</el-button>
    </div>
  </div>
</template>

<script>
import http from "@/utils/request";
import { ElMessage } from "element-plus";
export default {
  name: 'StatusPage',
  data() {
    return {
      band: '',
      status: null,
      tagType: ''
    }
  },
  mounted() {
    this.band = localStorage.getItem('band')
    // if (!localStorage.getItem('username')) {
    //   window.location.href = '/login'
    // }
    // if (localStorage.getItem('band')) {
    //  
    // } else {
    //   window.location.href = '/'
    // }
  },
  methods: {
    loadStatus() {
      http.post('/followRecord/followstatus', {valid: this.band}).then(res => {
        if(res.code=200){
           this.status = res.data
        }
        
      })
    }
  }
}
</script>
<style>
.tc {
  text-align: center;
}
.dialog-footer {
  margin-top: 40px;
  text-align: center;
}
</style>
